package com.share.iostream;

import java.io.*;

public class TestFileWriter {
	public static void main(String[] args) {
		FileWriter fw = null;
		try {
			fw = new FileWriter("e:\\test\\char.dat");
			for (int c = 0; c <= 100; c++) {
				fw.write(c);
			}
			fw.close();
		} catch (IOException e1) {
			e1.printStackTrace();
			System.out.println("文件写入错误");
			System.exit(-1);
		}
		System.out.println("成功写入!");		

	}
}
